<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改路段')"/>
            <th:block th:include="include :: datetimepicker-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-road_section-edit" th:object="${rdRoadSection}">
        <input name="id" th:field="*{id}" type="hidden">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">归属高速
                                ：</label>
                            <div class="col-sm-8">
                                <select name="rdHighSpeedRoad.id" class="form-control m-b"
                                        th:with="type=${highSpeedRoadsList}">
                                    <option th:each="dict : ${type}" th:text="${dict.name}"
                                            th:value="${dict.id}" th:field="*{rdHighSpeedRoad.id}"></option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">管养单位
                                ：</label>
                            <div class="col-sm-8">
                                <select name="rdManagementUnit.id" class="form-control m-b"
                                        th:with="type=${managementUnitList}">
                                    <option th:each="dict : ${type}" th:text="${dict.name}"
                                            th:value="${dict.id}" th:field="*{rdManagementUnit.id}"></option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">备注
                                ：</label>
                            <div class="col-sm-8">
                                <input name="remark" th:field="*{remark}" class="form-control"
                                       type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">路段
                                ：</label>
                            <div class="col-sm-8">
                                <input name="sectionName" th:field="*{sectionName}" class="form-control"
                                       type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">数据日期
                                ：</label>
                            <div class="col-sm-8">
                                <div class="input-group date">
                                    <input name="dataTime"
                                           th:value="${#dates.format(rdRoadSection.dataTime, 'yyyy-MM-dd')}"
                                           class="form-control" placeholder="yyyy-MM-dd"
                                           type="text">
                                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">编号
                                ：</label>
                            <div class="col-sm-8">
                                <input name="sectionId" th:field="*{sectionId}" class="form-control"
                                       type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">起点
                                ：</label>
                            <div class="col-sm-8">
                                <input name="startName" th:field="*{startName}" class="form-control"
                                       type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">终点
                                ：</label>
                            <div class="col-sm-8">
                                <input name="endName" th:field="*{endName}" class="form-control"
                                       type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">起始桩号
                                ：</label>
                            <div class="col-sm-8">
                                <input name="startPileNumber" th:field="*{startPileNumber}" class="form-control"
                                       type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">结束桩号
                                ：</label>
                            <div class="col-sm-8">
                                <input name="endPileNumber" th:field="*{endPileNumber}" class="form-control"
                                       type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">通车时间
                                ：</label>
                            <div class="col-sm-8">
                                <div class="input-group date">
                                    <input name="useTime"
                                           th:value="${#dates.format(rdRoadSection.useTime, 'yyyy-MM-dd')}"
                                           class="form-control" placeholder="yyyy-MM-dd"
                                           type="text">
                                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">序列号
                                ：</label>
                            <div class="col-sm-8">
                                <input name="serialNumber" th:field="*{serialNumber}" class="form-control"
                                       type="text">
                            </div>
                        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
        <th:block th:include="include :: datetimepicker-js"/>
<script th:inline="javascript">
    var prefix = ctx + "road/road_section";
    $("#form-road_section-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-road_section-edit').serialize());
        }
    }

            $("input[name='dataTime']").datetimepicker({
                format: "yyyy-mm-dd",
                minView: "month",
                autoclose: true
            });

            $("input[name='useTime']").datetimepicker({
                format: "yyyy-mm-dd",
                minView: "month",
                autoclose: true
            });
</script>
</body>
</html>
